package com.qiaofang.entity;

import com.qiaofang.common.model.BaseDomain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 部门
 */
@Data
@Entity
@Table(name = "tm_department")
public class Department extends BaseDomain {

    @ApiModelProperty("部门编号，和商户编码挂钩，用于部门数据权限控制")
    @Column(name = "department_code")
    private String departmentCode;

    @ApiModelProperty("权限编码")
    @Column(name = "permission_code")
    private String permissionCode;

    @ApiModelProperty("上级部门ID，如果为-1则为顶级部门")
    @Column(name = "parent_id")
    private Long parentId;

    @ApiModelProperty("部门名称")
    @Column(name = "department_name")
    private String departmentName;

    @ApiModelProperty("部门层级")
    @Column(name = "layer")
    private Integer layer;

    @ApiModelProperty("排序编号，用于排序")
    @Column(name = "sort")
    private String sort;

    @ApiModelProperty("备注")
    @Column(name = "remark")
    private String remark;

    @ApiModelProperty("商户ID")
    @Column(name = "merchant_id")
    private Long merchantId;

    @ApiModelProperty("结佣方式 1、签约结佣 2、按揭结佣")
    @Column(name = "commission_way")
    private String commissionWay;

    @ApiModelProperty("成交佣金")
    @Column(name = "commission")
    private String commission;

    @ApiModelProperty("带看奖励")
    @Column(name = "reward")
    private String reward;

    @ApiModelProperty("使用楼盘佣金 0: 否, 1: 是")
    @Column(name = "premises_commission")
    private String premisesCommission;

    @ApiModelProperty("对接人id")
    @Column(name = "principal")
    private Long principal;

    @ApiModelProperty("区域名称")
    @Column(name = "area_name")
    private String areaName;

    @CreatedBy
    @ApiModelProperty("创建人ID,关联用户表")
    @Column(name = "create_user_id")
    private Long createUserId;

    @LastModifiedBy
    @ApiModelProperty("修改人ID,关联用户表")
    @Column(name = "update_user_id")
    private Long updateUserId;

    @ApiModelProperty("是否删除:[{key:del_flag,values:[{no:0,alias:UNDEL,remark:否},{no:1,alias:DEL,remark:是}]}]")
    @Column(name = "del_flag")
    private String delFlag;

}
